﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;

namespace Sample.ItemsControl
{
  public class UcItemsControlViewModel
  {
    private string _name;

    private RelayCommand _actionCommand;

    public RelayCommand ActionCommand
    {
      get
      {
        return _actionCommand ?? (_actionCommand = new RelayCommand(ExecuteActionCommand));
      }
    }

    public string Name
    {
      get { return _name; }
      set { _name = value; }
    }

    public UcItemsControlViewModel(string name)
    {
      Name = name;
    }

    private void ExecuteActionCommand()
    {
      Messenger.Default.Send("Test");
    }
  }
}
